package com.core.shared;

import java.awt.*;

/**
 * Created with IntelliJ IDEA.
 * User: lxf
 * Date: 2016/12/23
 * Time: 11:51
 * To change this template use Editor | File and Code Templates.
 */
public class ColorUtils {

    public final static int pink = 0xFFC0CB;
    public final static int lightPink = 0xFFB6C1;
    public final static int crimson = 0xDC143C;
    public final static int lavenderBlush = 0xFFF0F5;
    public final static int paleVioletRed = 0xDB7093;
    public final static int hotPink = 0xFF69B4;
    public final static int deepPink = 0xFF1493;
    public final static int mediumVioletRed = 0xC71585;
    public final static int orchid = 0xDA70D6;
    public final static int thistle = 0xD8BFD8;
    public final static int plum = 0xDDA0DD;
    public final static int violet = 0xEE82EE;
    public final static int magenta = 0xFF00FF;
    public final static int fuchsia = 0xFF00FF;
    public final static int darkMagenta = 0x8B008B;
    public final static int purple = 0x800080;
    public final static int mediumOrchid = 0xBA55D3;
    public final static int darkVoilet = 0x9400D3;
    public final static int darkOrchid = 0x9932CC;
    public final static int indigo = 0x4B0082;
    public final static int blueViolet = 0x8A2BE2;
    public final static int mediumPurple = 0x9370DB;
    public final static int mediumSlateBlue = 0x7B68EE;
    public final static int slateBlue = 0x6A5ACD;
    public final static int darkSlateBlue = 0x483D8B;
    public final static int lavender = 0xE6E6FA;
    public final static int ghostWhite = 0xF8F8FF;
    public final static int blue = 0x0000FF;
    public final static int mediumBlue = 0x0000CD;
    public final static int midnightBlue = 0x191970;
    public final static int darkBlue = 0x00008B;
    public final static int navy = 0x000080;
    public final static int royalBlue = 0x4169E1;
    public final static int cornflowerBlue = 0x6495ED;
    public final static int lightSteelBlue = 0xB0C4DE;
    public final static int lightSlateGray = 0x778899;
    public final static int slateGray = 0x708090;
    public final static int doderBlue = 0x1E90FF;
    public final static int aliceBlue = 0xF0F8FF;
    public final static int steelBlue = 0x4682B4;
    public final static int lightSkyBlue = 0x87CEFA;
    public final static int skyBlue = 0x87CEEB;
    public final static int deepSkyBlue = 0x00BFFF;
    public final static int lightBLue = 0xADD8E6;
    public final static int powDerBlue = 0xB0E0E6;
    public final static int cadetBlue = 0x5F9EA0;
    public final static int azure = 0xF0FFFF;
    public final static int lightCyan = 0xE1FFFF;
    public final static int paleTurquoise = 0xAFEEEE;
    public final static int cyan = 0x00FFFF;
    public final static int aqua = 0x00FFFF;
    public final static int darkTurquoise = 0x00CED1;
    public final static int darkSlateGray = 0x2F4F4F;
    public final static int darkCyan = 0x008B8B;
    public final static int teal = 0x008080;
    public final static int mediumTurquoise = 0x48D1CC;
    public final static int lightSeaGreen = 0x20B2AA;
    public final static int turquoise = 0x40E0D0;
    public final static int auqamarin = 0x7FFFAA;
    public final static int mediumAquamarine = 0x00FA9A;
    public final static int mediumSpringGreen = 0xF5FFFA;
    public final static int mintCream = 0x00FF7F;
    public final static int springGreen = 0x3CB371;
    public final static int seaGreen = 0x2E8B57;
    public final static int honeydew = 0xF0FFF0;
    public final static int lightGreen = 0x90EE90;
    public final static int paleGreen = 0x98FB98;
    public final static int darkSeaGreen = 0x8FBC8F;
    public final static int limeGreen = 0x32CD32;
    public final static int lime = 0x00FF00;
    public final static int forestGreen = 0x228B22;
    public final static int green = 0x008000;
    public final static int darkGreen = 0x006400;
    public final static int chartreuse = 0x7FFF00;
    public final static int lawnGreen = 0x7CFC00;
    public final static int greenYellow = 0xADFF2F;
    public final static int oliveDrab = 0x556B2F;
    public final static int beige = 0x6B8E23;
    public final static int lightGoldenrodYellow = 0xFAFAD2;
    public final static int ivory = 0xFFFFF0;
    public final static int lightYellow = 0xFFFFE0;
    public final static int yellow = 0xFFFF00;
    public final static int olive = 0x808000;
    public final static int darkKhaki = 0xBDB76B;
    public final static int lemonChiffon = 0xFFFACD;
    public final static int paleGodenrod = 0xEEE8AA;
    public final static int khaki = 0xF0E68C;
    public final static int gold = 0xFFD700;
    public final static int cornislk = 0xFFF8DC;
    public final static int goldEnrod = 0xDAA520;
    public final static int floralWhite = 0xFFFAF0;
    public final static int oldLace = 0xFDF5E6;
    public final static int wheat = 0xF5DEB3;
    public final static int moccasin = 0xFFE4B5;
    public final static int orange = 0xFFA500;
    public final static int papayaWhip = 0xFFEFD5;
    public final static int blanchedAlmo = 0xFFEBCD;
    public final static int navajoWhite = 0xFFDEAD;
    public final static int antiqueWhite = 0xFAEBD7;
    public final static int tan = 0xD2B48C;
    public final static int brulyWood = 0xDEB887;
    public final static int bisque = 0xFFE4C4;
    public final static int darkOrange = 0xFF8C00;
    public final static int linen = 0xFAF0E6;
    public final static int peru = 0xCD853F;
    public final static int peachPuff = 0xFFDAB9;
    public final static int sandyBrown = 0xF4A460;
    public final static int chocolate = 0xD2691E;
    public final static int saddleBrown = 0x8B4513;
    public final static int seaShell = 0xFFF5EE;
    public final static int sienna = 0xA0522D;
    public final static int lightSalmon = 0xFFA07A;
    public final static int coral = 0xFF7F50;
    public final static int orangeRed = 0xFF4500;
    public final static int darkSalmon = 0xE9967A;
    public final static int tomato = 0xFF6347;
    public final static int mistyRose = 0xFFE4E1;
    public final static int salmon = 0xFA8072;
    public final static int snow = 0xFFFAFA;
    public final static int lightCoral = 0xF08080;
    public final static int rosyBrown = 0xBC8F8F;
    public final static int indianRed = 0xCD5C5C;
    public final static int red = 0xFF0000;
    public final static int brown = 0xA52A2A;
    public final static int fireBrick = 0xB22222;
    public final static int darkRed = 0x8B0000;
    public final static int maroon = 0x800000;
    public final static int white = 0xFFFFFF;
    public final static int whiteSmoke = 0xF5F5F5;
    public final static int gainsboro = 0xDCDCDC;
    public final static int lightGrey = 0xD3D3D3;
    public final static int silver = 0xC0C0C0;
    public final static int darkGray = 0xA9A9A9;
    public final static int gray = 0x808080;
    public final static int dimGray = 0x696969;
    public final static int black = 0x000000;


    /**
     * rgb转十六进制代码
     *
     * @param r
     * @param g
     * @param b
     * @return
     */
    public static String toHex(int r, int g, int b) {
        return Integer.toHexString(r) + Integer.toHexString(g) + Integer.toHexString(b);
    }

    /**
     * 十六进制代码转rgb数字
     *
     * @param hex
     * @return
     */
    public static int[] toRGB(String hex) {
        int[] rgb = new int[3];
        if (hex.indexOf("0x") != -1) {
            rgb[0] = Integer.parseInt(hex.substring(2, 4), 16);
            rgb[1] = Integer.parseInt(hex.substring(4, 6), 16);
            rgb[2] = Integer.parseInt(hex.substring(6), 16);
        } else {
            rgb[0] = Integer.parseInt(hex.substring(0, 2), 16);
            rgb[1] = Integer.parseInt(hex.substring(2, 4), 16);
            rgb[2] = Integer.parseInt(hex.substring(4), 16);
        }
        return rgb;
    }

}
